#include <bits/stdc++.h>
#define F(i,l,r) for(int i=(l);i<=(r);i++)
#define FF(i,r,l) for(int i=(r);i>=(l);i--)
#define M 100010
//#define maxn
#define ll long long
//#define int long long
#define pb(x) push_back(x)

using namespace std;
//const int mod

int n;
int a[M];
int c[M];
int maxn;
int ans;
bool flag;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    ios::sync_with_stdio(false);cin.tie(0),cout.tie(0);
    cin>>n;ans=n;
    F(i,1,n){
        int x;cin>>x;
        a[x]++;c[x]++;maxn=max(maxn,x);
    }int j;
    //cout<<maxn<<'\n';
    // F(i,1,maxn){
    //     if(a[i]){
    //         cout<<i<<' '<<a[i]<<'\n';
    //     }
    // }
    F(i,1,maxn-1){
        while(!a[i]){
            i++;
            if(i>=maxn){
                cout<<ans;return 0;
            }
        }
        j=i+1;
        while(a[i]){
            while(!c[j]){
                j++;
                if(j>maxn){cout<<ans;return 0;}
            }
            if(c[j]>=a[i]){c[j]-=a[i];ans-=a[i];a[i]=0;}
            else {a[i]-=c[j];ans-=c[j];c[j]=0;}
        }
    }
    cout<<ans;return 0;


    return 0;
}



